package view.leeds;

import javax.swing.JPanel;
import javax.swing.SpringLayout;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JTextArea;
import java.awt.Font;
import java.awt.Dimension;
import javax.swing.border.TitledBorder;
import java.awt.Color;
import javax.swing.UIManager;

public class CustomerInfoPanel extends JPanel 
{
	private JTextField textFieldName;
	private JTextField textFieldEmail;
	private JTextField textFieldCompany;
	private JTextField textFieldPhone;
	private JTextArea textAreaAddress;
	
	public CustomerInfoPanel() 
	{
		setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Customer Information", TitledBorder.LEFT, TitledBorder.TOP, null, Color.DARK_GRAY));
		setPreferredSize(new Dimension(285, 450));
		SpringLayout springLayout = new SpringLayout();
		setLayout(springLayout);
		
		JLabel lblName = new JLabel("Name");
		lblName.setFont(new Font("MS Reference Sans Serif", Font.PLAIN, 13));
		springLayout.putConstraint(SpringLayout.NORTH, lblName, 30, SpringLayout.NORTH, this);
		springLayout.putConstraint(SpringLayout.WEST, lblName, 30, SpringLayout.WEST, this);
		add(lblName);
		
		textFieldName = new JTextField();
		textFieldName.setFont(new Font("MS Reference Sans Serif", Font.PLAIN, 13));
		springLayout.putConstraint(SpringLayout.NORTH, textFieldName, 6, SpringLayout.SOUTH, lblName);
		springLayout.putConstraint(SpringLayout.WEST, textFieldName, 30, SpringLayout.WEST,this);
		add(textFieldName);
		textFieldName.setColumns(20);
		
		JLabel lblEmail = new JLabel("Email");
		lblEmail.setFont(new Font("MS Reference Sans Serif", Font.PLAIN, 13));
		springLayout.putConstraint(SpringLayout.NORTH, lblEmail, 30, SpringLayout.SOUTH, textFieldName);
		springLayout.putConstraint(SpringLayout.WEST, lblEmail, 30, SpringLayout.WEST,this);
		add(lblEmail);
		
		textFieldEmail = new JTextField();
		textFieldEmail.setFont(new Font("MS Reference Sans Serif", Font.PLAIN, 13));
		springLayout.putConstraint(SpringLayout.NORTH, textFieldEmail, 6, SpringLayout.SOUTH, lblEmail);
		springLayout.putConstraint(SpringLayout.WEST, textFieldEmail, 30, SpringLayout.WEST,this);
		add(textFieldEmail);
		textFieldEmail.setColumns(20);
		
		JLabel lblCompany = new JLabel("Company");
		lblCompany.setFont(new Font("MS Reference Sans Serif", Font.PLAIN, 13));
		springLayout.putConstraint(SpringLayout.NORTH, lblCompany, 30, SpringLayout.SOUTH, textFieldEmail);
		springLayout.putConstraint(SpringLayout.WEST, lblCompany, 30, SpringLayout.WEST,this);
		add(lblCompany);
		
		textFieldCompany = new JTextField();
		textFieldCompany.setFont(new Font("MS Reference Sans Serif", Font.PLAIN, 13));
		springLayout.putConstraint(SpringLayout.NORTH, textFieldCompany, 6, SpringLayout.SOUTH, lblCompany);
		springLayout.putConstraint(SpringLayout.WEST, textFieldCompany, 30, SpringLayout.WEST,this);
		add(textFieldCompany);
		textFieldCompany.setColumns(20);
		
		JLabel lblPhone = new JLabel("Phone");
		lblPhone.setFont(new Font("MS Reference Sans Serif", Font.PLAIN, 13));
		springLayout.putConstraint(SpringLayout.NORTH, lblPhone, 30, SpringLayout.SOUTH, textFieldCompany);
		springLayout.putConstraint(SpringLayout.WEST, lblPhone, 30, SpringLayout.WEST,this);
		add(lblPhone);
		
		textFieldPhone = new JTextField();
		textFieldPhone.setFont(new Font("MS Reference Sans Serif", Font.PLAIN, 13));
		springLayout.putConstraint(SpringLayout.NORTH, textFieldPhone, 6, SpringLayout.SOUTH, lblPhone);
		springLayout.putConstraint(SpringLayout.WEST, textFieldPhone, 30, SpringLayout.WEST,this);
		add(textFieldPhone);
		textFieldPhone.setColumns(20);
		
		JLabel lblAddress = new JLabel("Address");
		springLayout.putConstraint(SpringLayout.NORTH, lblAddress, 30, SpringLayout.SOUTH, textFieldPhone);
		springLayout.putConstraint(SpringLayout.WEST, lblAddress, 30, SpringLayout.WEST,this);
		lblAddress.setFont(new Font("MS Reference Sans Serif", Font.PLAIN, 13));
		add(lblAddress);
		
		textAreaAddress = new JTextArea();
		springLayout.putConstraint(SpringLayout.NORTH, textAreaAddress, 6, SpringLayout.SOUTH, lblAddress);
		springLayout.putConstraint(SpringLayout.WEST, textAreaAddress, 30, SpringLayout.WEST,this);
		textAreaAddress.setFont(new Font("MS Reference Sans Serif", Font.PLAIN, 13));
		textAreaAddress.setRows(3);
		textAreaAddress.setColumns(20);
		add(textAreaAddress);
	}

	public JTextField getTextFieldName() {
		return textFieldName;
	}

	public void setTextFieldName(JTextField textFieldName) {
		this.textFieldName = textFieldName;
	}

	public JTextField getTextFieldEmail() {
		return textFieldEmail;
	}

	public void setTextFieldEmail(JTextField textFieldEmail) {
		this.textFieldEmail = textFieldEmail;
	}

	public JTextField getTextFieldCompany() {
		return textFieldCompany;
	}

	public void setTextFieldCompany(JTextField textFieldCompany) {
		this.textFieldCompany = textFieldCompany;
	}

	public JTextField getTextFieldPhone() {
		return textFieldPhone;
	}

	public void setTextFieldPhone(JTextField textFieldPhone) {
		this.textFieldPhone = textFieldPhone;
	}

	public JTextArea getTextAreaAddress() {
		return textAreaAddress;
	}

	public void setTextAreaAddress(JTextArea textAreaAddress) {
		this.textAreaAddress = textAreaAddress;
	}
	
	
}
